# _*_ coding : utf-8 _*_
# @Time : 2023/8/24 19:05
# @Author : 寻梦
# @File : 03_urllib下载
# @Project : code
import urllib.request

# 下载一个网页
page_url='http://www.baidu.com'
urllib.request.urlretrieve(page_url,'baidu.html')
# 下载图片
image_url='https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2Febbc7255-dd4a-4529-9769-45055d6026c4%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1695467321&t=bb206bc6c921099d31e1852015711f9a'
urllib.request.urlretrieve(image_url,'lisa.jpg')
# 下载图片
vido_url='https://baikevideo.cdn.bcebos.com/media/mda-Ofj5DOML8EqV0Umy/da4f175769bcf693d0d0e205e1546015.mp4'
urllib.request.urlretrieve(vido_url,"秒懂百科.mp4")